package com.example.minefieldkeepercloud.util;
import android.content.Context;

/**
 * 文件存储 辅助类
 */
public class SPUtilHelper {

    public static final String ISLOGIN = "IsLogin";//是否自动登录
    public static final String PHONE = "phone";//本地保存的手机账号
    public static final String PWD = "pwd";//本地保存的密码

    public static final String ID = "ID";//登录返回的ID
    public static final String NAME= "name";//登录返回的姓名
    public static final String PHONENO= "phoneno";//登录返回的电话号码
    public static final String TOKEN= "TOKEN";//登录返回的电话号码

    public static final String BZL= "bzl";//矿机保证lv
    private static SPUtil instance = null;

    public static synchronized SPUtil getInstance(Context context) {
        if (instance == null) {
            instance = new SPUtil(context,"fileName");
        }
        return instance;
    }

    public static void setIsLogin(boolean b)
    {
        instance.putBoolean(ISLOGIN,b);
    }

    public static boolean getIsLogin()
    {
        return instance.getBoolean(ISLOGIN,false);
    }

    public static void setPhone(String phone)
    {
        instance.putString(PHONE,phone);
    }

    public static String getPhone()
    {
        return instance.getString(PHONE,"");
    }
    public static void setBzl(String phone)
    {
        instance.putString(BZL,phone);
    }

    public static String getBzl()
    {
        return instance.getString(BZL,"");
    }
    public static void setPwd(String pwd)
    {
        instance.putString(PWD,pwd);
    }

    public static String getPwd()
    {
        return instance.getString(PWD,"");
    }

    public static void setId(int id)
    {
        instance.putInt(ID,id);
    }

    public static int getId()
    {
        return instance.getInt(ID,0);
    }

    public static void setName(String name)
    {
        instance.putString(NAME,name);
    }

    public static String getName()
    {
        return instance.getString(NAME,"");
    }

    public static void setPhoneNo(String phoneNo)
    {
        instance.putString(PHONENO,phoneNo);
    }

    public static String getPhoneNo()
    {
        return instance.getString(PHONENO,"");
    }
     public static void setTOKEN(String token)
    {
        instance.putString(TOKEN,token);
    }

    public static String getToken()
    {
        return instance.getString(TOKEN,"");
    }


}
